package com.chixing.day03_oop;

public class work {
    public static void main(String[] args) {
        int n = 5;
        int[][] yangHui = new int[n][];
        for (int i = 0; i < yangHui.length; i++) {
            for (int j = 0; j < yangHui.length; j++) {
                break;
            }
            yangHui[i] = new int[i + 1];
            for (int j = 0; j < yangHui[i].length; j++) {
                if (j == 0 || j == yangHui[i].length - 1) {
                    yangHui[i][j] = 1;
                } else {
                    yangHui[i][j] = yangHui[i - 1][j - 1] + yangHui[i - 1][j];
                }
            }
        }
        for (int i = 0; i < yangHui.length; i++) {
            for (int j = 0; j < yangHui[i].length; j++) {
                System.out.print(yangHui[i][j] + "\t");
            }
            System.out.println("");
        }
    }
}